package com.chainyoung.component_tmperson.ui.mvp.model;

import com.chainyoung.common.appcommon.entity.CommonList;
import com.chainyoung.common.integration.IRepositoryManager;
import com.chainyoung.common.mvp.BaseModel;
import com.chainyoung.common.utils.RxUtils;
import com.chainyoung.component_tmperson.api.PersonService;
import com.chainyoung.component_tmperson.entity.BookMark;
import com.chainyoung.component_tmperson.entity.PurseAddrItem;
import com.chainyoung.component_tmperson.ui.mvp.contract.BrowserCollectionContract;
import com.chainyoung.component_tmperson.ui.mvp.contract.GetPurseListContract;

import java.util.List;
import java.util.TreeMap;

import javax.inject.Inject;

import io.reactivex.Flowable;

public class BrowserCollectionModel extends BaseModel implements BrowserCollectionContract.Model {

    @Inject
    BrowserCollectionModel(IRepositoryManager repositoryManager) {
        super(repositoryManager);

    }


    @Override
    public Flowable<List<BookMark>> getBookmarkList(TreeMap<String, Object> map) {
        return mRepositoryManager.obtainRetrofitService(PersonService.class)
                .getBookmarkList(map)
                .compose(RxUtils.<List<BookMark>>handleResult());
    }

    @Override
    public Flowable<List<BookMark>> delBookmarkList(TreeMap<String, Object> map) {
        return mRepositoryManager.obtainRetrofitService(PersonService.class)
                .delBookmark(map)
                .compose(RxUtils.<List<BookMark>>handleResult());
    }
}

